//	--------------------------------------------------------------------
//	Copyright(C) 2006,2007 Zhao Yukun. All rights reserved.
//	This file is a part of the Xeres system.
//	Xeres 2007
//	Contact : xeres.engine@gmail.com
//	$(reservedInfo)
//	$(reservedDeclaration)
//	--------------------------------------------------------------------
///	@file	<DefaultInputAdaptor.h>
///	@path	~/src/appear/xwin/
///	@date	2007/11/06
///	@desc	Default input adapter.

#pragma once

#include "xeres.h"

#include "appear/app/input_handler.h"
#include "appear/app/message_filter.h"

namespace xeres {

	/*!
		\class	DefaultInputAdaptor
		\brief	Use windows's event system to make input messages.
	*/
	class DefaultInputAdaptor : public InputDispatcher , public MessageFilter
	{
	public:

		/// \ctor
		DefaultInputAdaptor( InputHandler * inputHandler );

		/*!
			\brief		Filter messages,
						return true to stop next level,
						otherwise engine will search next filter.
		*/
		virtual bool Filter( HWND hWnd , UINT message , WPARAM wParam , LPARAM lParam );

		///	\brief	Process key input message.
		virtual HandleInput OnKeyInput( const KeyInput& input );

		///	\brief	Process mouse input message.
		virtual HandleInput OnMouseInput( const MouseInput& input );

	private:

	//@ data

		// input handler
		InputHandler *	m_inputHandler;
	};

} // namespace xeres
